package com.qf.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.baseservice.impl.BaseServiceImpl;
import com.qf.entity.OrderDetails;
import com.qf.mapper.IOrderDetailsMapper;
import com.qf.mapper.IOrderMapper;
import com.qf.service.IOrderDetailsService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @Author：刘亚康
 * @Date：2020/4/12
 * @QQ：50770284
 * @Phone：18235947935
 * @Desc :
 **/
@Service
public class OrderDetailsServiceImpl extends BaseServiceImpl<OrderDetails> implements IOrderDetailsService {
    @Autowired
    private IOrderDetailsMapper orderDetailsMapper;

    @Override
    protected BaseMapper<OrderDetails> getBaseMapper() {
        return orderDetailsMapper;
    }

    /**
     * 添加订单中的集合
     *
     * @param orderDetailsList
     * @return
     */
    @Override
    public int insertOrderDetailsList(List<OrderDetails> orderDetailsList) {
        int insert=0;
        for (OrderDetails orderDetails : orderDetailsList) {
            insert = orderDetailsMapper.insert(orderDetails);

        }
        return insert;
    }
}
